package com.cskaoyan.javase.method.exercise4;

/**
 * @description: 练习1
 * @author: wuguidong@cskaoyan.onaliyun.com
 **/

import java.util.Scanner;

/**
 * 键盘录入两个值，求最大值
 *
 */
public class Demo {
    public static void main(String[] args) {
        //键盘录入
        Scanner sc = new Scanner(System.in);
        System.out.println("请键盘录入两个double数据：");
        double a = sc.nextDouble();
        double b = sc.nextDouble();
        System.out.println("传入的两个数的最大值是：" + getMaxValue(a, b));
    }

    public static double getMaxValue(double a, double b) {
        //三目运算符求最大值
        return (a > b) ? a : b;
    }

}
